
<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content">
  <?php /*
  <div class="top">
    <div class="left"></div>
    <div class="right"></div>
    <div class="center">
    */ ?>
      <h1>
      <?php //echo $heading_title; 
      ?></h1>
    <?php
    //</div> 
    
  //</div>?>
  
  
    <?php  if (!$logged) { ?>
    
    <div style="height:200px;">
    <?php echo "&nbsp;&nbsp;&nbsp;".$text_login;?>
    </div>
    
    <?php } else{ ?>

  <div class="middle">
    <div style="width: 100%; margin-bottom: 30px; ">

   		<div style="width:60%; float:left; ">
			
			<?php // Vendor image ?>
			<?php if ($vendors) { ?>
			<div style="text-align: center; vertical-align: top;">
				<img src="<?php echo $vendors[0]['image']; ?>" title="<?php echo $vendors[0]['name']; ?>" alt="<?php echo $vendors[0]['name']; ?>" id="image" style="margin-bottom: 3px;"/>
			</div>
			<?php } ?>
			
			<?php // Product image (standard) ?>
			<div style="text-align: center; vertical-align: top;">
				<a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" class="thickbox">
				<img src="<?php echo $thumb; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" id="image" style="margin-bottom: 3px;" /></a>
				<br />
				<span style="font-size: 11px;"><?php //echo $text_enlarge; ?></span>
			</div>

			<?php } ?>
			
            
            
   
   		    <?php //General div to hold wishlist, fb buttons?>
            <div style="width: 100%;padding: 10px 10px 1px 10px;min-height: 20px;" >
            
            <div style="width:41%; float:left;">
            <form action="<?php echo str_replace('&', '&amp;', $action); ?>" method="post" enctype="multipart/form-data" id="product">
			<?php if ($display_price) { ?>
				<div style="text-align: left; padding-bottom:10px">
					<input type="hidden" name="quantity" size="3" value="1" />
                    <?php //class="button" id="add_to_cart" ?>
					<a onclick="$('#product').submit();" style="text-decoration:none;">
                    <img src="catalog/view/theme/default/image/wishlist.png" />
                    <span><?php echo " ".$button_add_to_wishlist; ?></span>
                    </a>
				</div>
              <input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
              <input type="hidden" name="redirect" value="<?php echo str_replace('&', '&amp;', $redirect); ?>" />			
            </form>
            </div>
            
            <?php // Facebook share ?>
			<div style="width:29%; float:left;">
				<a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
			</div>
            
            <?php //FB likes ?>
            <div style="width:30%; float:right;">
				<iframe src="http://www.facebook.com/widgets/like.php?href=<?php echo $redirect; ?>" scrolling="no" frameborder="0" style="border:none; width:260px; height:25px;"></iframe>
			</div>
            
            </div><?php //End of general div?>
            
            <div style="position:relative; top:20px;"> <?php //End of button group ?>
            <?php //The Next and Previous Button
            $prevurl = "";
            if($prev!="")
            {
                $prevurl = "location.href='index.php?route=product/product&product_id=".$prev."';";
            ?>
                <div class="previous" onclick="<?php echo $prevurl ?>" title="Previous Item">
                </div>
            <?php
            }
            ?>

    		
            <?php 
            $nexturl="";
            if($next!="")
            {
                $nexturl = "location.href='index.php?route=product/product&product_id=".$next."';";
            ?>
                <div class="next" onclick="<?php echo $nexturl ?>" title="Next Item">
                </div>

            <?php
            }//End of Next and Previous Button
            ?>
            </div> <?php //End of button group ?>
            
		</div>
		
        <?php //Product Details Info ?>
		<div style="width:30%; float:right; ">
		
			<table width="100%" height="100%" style="horizontal-align:right; padding-left:5px; padding-top:10px"> 	
				<?php // Product information ?>
				<tr class="product_details_header">
					<th colspan="2" class="details_header_text"><?php echo $text_product_info; ?></th>
				</tr>
                
				<?php // Model ?>
				<tr>					
					<td class="product_info_label"><?php echo $text_model; ?></td>
					<td class="product_info_value"><?php echo $text_divider . $model; ?></td>
				</tr>
				
				<?php // Additional attributes ?>
				<?php if (isset($attributes)) { ?>
					<?php foreach($attributes as $attribute) { ?>
						<tr>					
						<td class="product_info_label"><?php echo $attribute['label']; ?></td>
						<td class="product_info_value">
							<?php echo $text_divider ?><?php echo $attribute['value']; ?>
						</td>
					</tr>
					<?php } // End for ?>
				<?php } // End if ?>
				
				<?php // Manufacturer ?>
				<?php if (isset($manufacturer)) { ?>
					<tr>					
						<td class="product_info_label"><?php echo $text_manufacturer; ?></td>
						<td class="product_info_value">
							<?php echo $text_divider ?><a href="<?php echo str_replace('&', '&amp;', $manufacturers); ?>"><?php echo $manufacturer; ?></a>
						</td>
					</tr>
				<?php } // End if ?>
				
				<?php // Availability ?>
				<?php if (isset($stock)) { ?>
					<tr>					
						<td class="product_info_label"><?php echo $text_availability; ?></td>
						<td class="product_info_value"><?php echo $text_divider . $stock; ?></td>
					</tr>
				<?php } // End if ?>
				
				<tr height="25px"><?php // Empty/divider space ?></tr>
				<tr>
					<?php // Description ?>
					<td colspan="2">
						<div  class="product_info_label"><?php echo $tab_description; ?></div>
						<div class="product_info_value"><?php echo $description; ?></div>
					</td>					
				</tr>	
				<?php // Vendor information ?>
				<?php if ($vendors) { ?>
				<tr height="25px"><?php // Empty/divider space ?></tr>	
				<tr class="product_details_header">
					<td colspan="2" class="details_header_text"><?php echo $text_contact; ?></td>
				</tr>				
					<?php foreach ($vendors as $vendor) { ?>
						<?php // Vendor name ?>
						<tr>
							<td colspan="2" class="product_info_label"><?php echo $vendor['name']; ?></div>
						</tr>	
						<?php // Vendor address ?>
						<?php if (!empty($vendor['address'])) { ?>
						<tr>
							<td colspan="2"><?php echo $vendor['address']; ?></td>
						</tr>
						<?php } ?>
						
						<?php // Vendor telephone ?>
						<?php if (!empty($vendor['telephone'])) { ?>
						<tr>
							<td colspan="2"><?php echo $text_telephone . $text_divider . $vendor['telephone']; ?></td>
						</tr>
						<?php } ?>
						
						<?php // Vendor email ?>
						<?php if (!empty($vendor['email'])) { ?>
						<tr>
							<td colspan="2"><?php echo $text_email. $text_divider . $vendor['email']; ?></td>
						</tr>
						<?php } ?>
						
						<?php // Vendor website ?>
						<?php if (!empty($vendor['website'])) { ?>
						<tr>
							<td colspan="2"><?php echo $text_website . $text_divider ?><a href="<?php echo $vendor['website']; ?>"><?php echo $vendor['website']; ?></a></td>
						</tr>
						<?php } ?>						
					<?php } // End for each ?>					
				<?php } // End if ?>
				
				<?php // Price ?>
				<?php if ($display_price) {	// Check if we can display the price (ex: for users who are not logged in) ?>
					<tr height="10px"><?php // Empty/divider space ?></tr>	
					<tr class="product_details_header">
						<td colspan="2" class="details_header_text"><?php echo $text_price; ?></td>               
					</tr>
					<tr>
						<td colspan="2" style="text-align:right">
						<?php if (!$special) { // Check if its discounted ?>
							<span class="product_price_value"><?php echo $price; ?></span>
						<?php } else { ?>
							<span class="product_price_value promotion_linethrough"><?php echo $price; ?></span>
						<?php } ?>
						</td>
					</tr>
					<?php if ($special) { // Check if in promotion ?>
					<tr height="10px"><?php // Empty/divider space ?></tr>	
					<tr class="product_details_header product_promo_header">
						<td colspan="2" class="details_header_text details_promo_header_text"><?php echo $text_promo_price; ?></td>               
					</tr>
					<tr>
						<td colspan="2" style="text-align:right">
							<span class="product_price_value product_promo_price_value"><?php echo $special; ?></span>
						</td>
					</tr>
						<?php // Promotion validity dates ?>
						<?php if (isset($promo_validity)) { ?>
						<tr class="product_details_header">
							<td colspan="2" class="details_header_text"><?php echo $text_offer_validity; ?></td>               
						</tr>
						<tr>						
							<td colspan="2" style="text-align:right;">	
								<?php //the next 3 lines has been commented as start date of promotion is not found in client template 
								/*
								<?php // Start date of promo ?>
								<?php if (isset($promo_validity['date_start']) && $promo_validity['date_start'] != '0000-00-00') { ?>
                                
									<?php echo $text_promo_from; ?>&nbsp;
									<span class="product_promo_period">
									<?php echo date("jS F Y", strtotime($promo_validity['date_start']))?>
									</span>&nbsp;									
								<?php } ?>
								<?php if (isset($promo_validity['date_end']) && $promo_validity['date_end'] != '0000-00-00') { ?>
									<?php if (isset($promo_validity['date_start']) && $promo_validity['date_start'] != '0000-00-00') { ?>
										<?php echo $text_promo_to; ?>&nbsp;	
									<?php } ?>											
								<?php } ?>	
								*/ ?> 
								<?php // End date of promo ?>
								<?php if (isset($promo_validity['date_end']) && $promo_validity['date_end'] != '0000-00-00') { ?>
									<span class="product_promo_period">
									<?php echo date("jS F Y", strtotime($promo_validity['date_end'])) ; ?>
									</span>	
								<?php } ?>
						
							</td>
						</tr>
						<?php } ?>
					<?php } ?>
					
				
					<?php // Bulk discounts ?>
					  <?php if ($discounts) { ?>
						<tr height="10px"><?php // Empty/divider space ?></tr>	
						<tr class="product_details_header">
							<td colspan="2" class="details_header_text"><?php echo $text_discount; ?></td>               
						</tr>	
						<tr>
							<td colspan="2" style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px; margin-top: 2px; margin-bottom: 15px;">
					 
								<table style="width: 100%;">
								  <tr>
									<td class="product_info_label" style="text-align: right;"><?php echo $text_order_quantity; ?></td>
									<td class="product_info_label" style="text-align: right;"><?php echo $text_price_per_item; ?></td>
								  </tr>
								  <?php foreach ($discounts as $discount) { ?>
								  <tr>
									<td style="text-align: right;"><?php echo $discount['quantity']; ?></td>
									<td style="text-align: right;"><?php echo $discount['price']; ?></td>
								  </tr>
								  <?php } ?>
								</table>					 
							</td>
						<tr>						
					  <?php } ?>

					
					
					
              <?php } // End display price?>              
			</table>
		</div>     
	        <?php /* if ($display_price) { ?>
			
			<?php // Available options (extra options that can be added to the product -> can increase/decrease price) 
			
            <form action="<?php echo str_replace('&', '&amp;', $action); ?>" method="post" enctype="multipart/form-data" id="product">
              <?php if ($options) { ?>
              <b><?php echo $text_options; ?></b><br />
              <div style="background: #FFFFCC; border: 1px solid #FFCC33; padding: 10px; margin-top: 2px; margin-bottom: 15px;">
                <table style="width: 100%;">
                  <?php foreach ($options as $option) { ?>
                  <tr>
                    <td><?php echo $option['name']; ?>:<br />
                      <select name="option[<?php echo $option['option_id']; ?>]">
                        <?php foreach ($option['option_value'] as $option_value) { ?>
                        <option value="<?php echo $option_value['option_value_id']; ?>"><?php echo $option_value['name']; ?>
                        <?php if ($option_value['price']) { ?>
                        <?php echo $option_value['prefix']; ?><?php echo $option_value['price']; ?>
                        <?php } ?>
                        </option>
                        <?php } ?>
                      </select></td>
                  </tr>
                  <?php } ?>
                </table>
              </div>
              <?php } ?>
			  */
			  ?>
			  
              <?php /* // Add to cart -> Converted to wishlist
              <div class="content"><?php echo $text_qty; ?>
                <input type="input" name="quantity" size="3" value="1" />
                <a onclick="$('#product').submit();" id="add_to_cart" class="button"><span><?php echo $button_add_to_cart; ?></span></a></div>
              <div>
			 
              <input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
              <input type="hidden" name="redirect" value="<?php echo str_replace('&', '&amp;', $redirect); ?>" /></div>
            </form>
            <?php }  */ ?>
		
    </div>
              
    <div id="tab_image" style="clear: both;padding-top:10px">
      <?php if ($images) { ?>
      <div style="display: inline-block;">
        <?php foreach ($images as $image) { ?>
        <div style="display: inline-block; float: left; text-align: center; margin-left: 5px; margin-right: 5px; margin-bottom: 10px;"><a href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>" class="thickbox"><img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" style="border: 1px solid #DDDDDD; margin-bottom: 3px;" /></a><br />
          <span style="font-size: 11px;"><?php //echo $text_enlarge; ?></span></div>
        <?php } ?>
      </div>
      <?php } 
      else { /*?>
      <div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px; margin-bottom: 10px;">
      <?php echo $text_no_images; ?>
      </div>
      <?php*/ } ?>
      
    </div>
    <div style="padding-right:100px;">
    
    </div>
  </div>
  <?php } ?>
  
  
  <div <?php //class="bottom" ?> >
    <div class="left"></div>
    <div class="right"></div>
    <div class="center"></div>
  </div>
</div>
<script type="text/javascript"><!--
$('#review .pagination a').live('click', function() {
	$('#review').slideUp('slow');
		
	$('#review').load(this.href);
	
	$('#review').slideDown('slow');
	
	return false;
});			

$('#review').load('index.php?route=product/product/review&product_id=<?php echo $product_id; ?>');

function review() {
	$.ajax({
		type: 'POST',
		url: 'index.php?route=product/product/write&product_id=<?php echo $product_id; ?>',
		dataType: 'json',
		data: 'name=' + encodeURIComponent($('input[name=\'name\']').val()) + '&text=' + encodeURIComponent($('textarea[name=\'text\']').val()) + '&rating=' + encodeURIComponent($('input[name=\'rating\']:checked').val() ? $('input[name=\'rating\']:checked').val() : '') + '&captcha=' + encodeURIComponent($('input[name=\'captcha\']').val()),
		beforeSend: function() {
			$('.success, .warning').remove();
			$('#review_button').attr('disabled', 'disabled');
			$('#review_title').after('<div class="wait"><img src="catalog/view/theme/default/image/loading_1.gif" alt="" /> <?php echo $text_wait; ?></div>');
		},
		complete: function() {
			$('#review_button').attr('disabled', '');
			$('.wait').remove();
		},
		success: function(data) {
			if (data.error) {
				$('#review_title').after('<div class="warning">' + data.error + '</div>');
			}
			
			if (data.success) {
				$('#review_title').after('<div class="success">' + data.success + '</div>');
								
				$('input[name=\'name\']').val('');
				$('textarea[name=\'text\']').val('');
				$('input[name=\'rating\']:checked').attr('checked', '');
				$('input[name=\'captcha\']').val('');
			}
		}
	});
}
//--></script>
<script type="text/javascript"><!--
$.tabs('.tabs a'); 
//-->
</script>
<?php echo $footer; ?> 